<?php

if( !defined("IN_ELCIUS") ) exit;

// TODO: allot of trust is placed on armory api data, validation may be needed.

$PageData['Guild'] = array(
	'Name' => $Settings['Guild']['Name'],
	'Region' => $Settings['Guild']['Region'],
	'Realm' => $Settings['Guild']['Realm'],
);

$GuildData = WowArmory::Fetch(
	'guild',
	$Settings['Guild']['Name'],
	$Settings['Guild']['Realm'],
	KiwiRequest::$Data['ContentName'] == 'roster' ? 'members' : ''
);

if( $GuildData ){
	
	// procress guild data
	$factions = array(
		'0' => array('Name'=>'Alliance','Char'=>'A'),
		'1' => array('Name'=>'Horde','Char'=>'H'),
	);
	$PageData['Guild']['Faction'] = $factions[$GuildData['side']];
	$PageData['Guild']['Battlegroup'] = $GuildData['battlegroup'];
	$PageData['Guild']['Level'] = $GuildData['level'];
	
}

?>